<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@page import="com.wzw.weibo.UtilTools"%>
<%@page import="java.io.File"%>
<%@page import="com.wzw.weibo.PicCompress"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>中秋贺卡</title>
<link href="css/main.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<%
	String uname = request.getParameter("uname"); 
	String toast = request.getParameter("toast"); 
	if(uname==null||"".equals(uname)||toast==null||"".equals(toast)){
		response.sendRedirect("index.jsp");
		return;
	}
	uname = new String(request.getParameter("uname").getBytes("iso-8859-1"),"utf-8").trim();
	toast = new String(request.getParameter("toast").getBytes("iso-8859-1"),"utf-8").trim();

	String appPath = request.getScheme() + "://" +request.getServerName()+":"+request.getServerPort()+request.getContextPath();
	String uploadImageUrl = appPath + "/upload";
	String uploadImageRealPath = request.getRealPath("/") + "upload\\";
	System.out.println("uploadImageRealPath=" + uploadImageRealPath);
	String imgName = "zq_03.jpg";
	String imgNamePng = "card_" + uname.hashCode() + ".png";
	if(!new File(uploadImageRealPath + imgNamePng).exists()){
		System.out.println("Generate " + uploadImageRealPath + imgNamePng);
		UtilTools.saveHTML(UtilTools.generateHTML(appPath + "/images/" + imgName, uname, toast), uploadImageRealPath + imgNamePng, null);
		new PicCompress().doSimpleCompress(uploadImageRealPath, imgNamePng, 100);
	}
%>
<body>
<input type="hidden" id="sharePath" value="<%=appPath%>"/>
<input type="hidden" id="shareContent" value="我正在参加#汇丰晋信#发起的#中秋送贺卡#活动，快来给您的家人和朋友送上中秋佳节最真挚的祝福! 贺卡活动地址:"/>
<input type="hidden" id="sharePic" value="<%=uploadImageUrl%>/<%=imgNamePng%>" />
<div class="head">
  <div class="top">
    <div class="box01">
      值此佳节，<br/>您的朋友&nbsp;<%=uname%>&nbsp;祝您：<br> 
	<%=toast%>
	</div>
	<div class="box05"><a href="mid.jsp"><img src="images/icon05.png" width="150" height="50" border="0"/></a></div>
    <div class="box04">
    	<!-- <a href="javascript:window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.getElementById('shareContent').value)+'&pic='+encodeURIComponent(document.getElementById('sharePic').value)+'&url='+encodeURIComponent(document.getElementById('sharePath').value)+'&rcontent=','_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0"><img src="images/icon03.png" width="145" height="40" border="0" /></a> -->
    	<a href="javascript:window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.getElementById('shareContent').value)+encodeURIComponent(document.getElementById('sharePath').value)+'&pic='+encodeURIComponent(document.getElementById('sharePic').value),'_blank','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0"><img src="images/icon03.png" width="145" height="40" border="0" /></a>
    	<a href="javascript:window.open('http://weibo.com/hsbcjt');void 0"><img src="images/icon04.png" width="220" height="40" border="0" /></a>
    </div>
  </div>
</div>
<div class="foot">
  <div class="foot_right"><a href="http://smart-system.vicp.net:8088/xztz"><img src="images/icon06.png" border="0"/></a></div>
</div>
</body>
</html>
